package com.minio.template;

import io.minio.messages.Item;
import java.io.InputStream;
import java.util.List;

/**
 * @ClassName: MinioOperations
 * @Description: minio操作接口
 * @Author: xuweiLi
 * @Create: 2025/7/4 20:28
 **/
public interface MinioOperations {
    // 上传文件
    void uploadObject(String objectName, InputStream stream, long size ,String contentType) throws Exception;
    
    // 下载文件
    InputStream downloadObject(String objectName) throws Exception;
    
    // 删除文件
    void deleteObject(String objectName) throws Exception;
    
    // 获取文件URL
    String getObjectUrl(String objectName) throws Exception;
    
    // 获取预签名上传URL
    String getPresignedPutUrl(String objectName, int expiryMinutes) throws Exception;
    
    // 列出存储桶中的对象
    List<Item> listObjects(String prefix) throws Exception;
    
    // 检查文件是否存在
    boolean objectExists(String objectName) throws Exception;
}